<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<title>申请提现</title>
<link href="Style/Common.css" rel="stylesheet">
<link href="Style/Employ.css" rel="stylesheet">
<script src="Js/jquery.min.js" type="text/javascript"></script>
<script src="Js/Banner.js" type="text/javascript"></script>
    <script language="javascript">
        function save() {
            var _money = $("#inputmoney").val();
            var _CardNumber = $("#card").val();
            var _TrueName = escape($("#truename").val());
            var _BinkInfo = escape(document.getElementById("select_card").value);
            var _pwd = $("#pwd").val();
            if (_money == "") { alert('请输入金额'); return; }
            if (_money && parseInt(_money) < 1) { alert('请输入正确的金额'); return; }
            if (_CardNumber.length == "") { alert('请选择银行卡号'); return; }
            if (_pwd == "") { alert('请输入交易密码'); return; }
            $.ajax({
                type: "post",
                url: "/ServiceInterface/MyBankAndMoney.ashx",
                data: { flag: "applycash", money: _money, CardNumber: _CardNumber, BinkInfo: _BinkInfo, pwd1: _pwd, TrueName: _TrueName },
                dataType: "text",
                async: false,
                success: function (data) {
                    if (data == '1') {
                        alert('申请提交成功，我们将在2个工作日内进行审核并完成提现！');
                        location.href = "MyMoney.html"
                    } else {
                        alert(data);
                    }
                }
            });
        }
        
        function bindcard() {
            $.ajax({
                type: "post",
                url: "/ServiceInterface/MyBankAndMoney.ashx",
                data: { flag: "bindcard" },
                dataType: "text",
                async: true,
                success: function (data) {
                    $("#select_card").append(data);
                }
            });
        }

        function selectcard() {
            var _CardNumber = document.getElementById("select_card").value;
            //alert(_CardNumber);
            var arr = _CardNumber.split('|');
            $("#truename").val(arr[0]);
            $("#card").val(arr[1]);
            $("#address").val(arr[2]);
            $("#area").val(arr[3]);
        }

        function showkoumoney() {
            var m2 = $.ajax({ url: "/ServiceInterface/MyBankAndMoney.ashx?flag=koumoney&money=" + $("#inputmoney").val(), async: false }).responseText;
            if (!m2) { m2 = "0"; }
            $("#koumoney").val("-" + m2);
        }
    </script>
</head>

<body>
 <div class="Header">  
  <p>申请提现</p>
  <span  onclick="location.href = 'MyMoney.html';"><img src="Images/Return.png"></span>
  <a onclick="save()">保存</a>
 </div><!--Header end-->
 <ul class="EnterId" style="width:96%;padding:0 2%;background:#fff;border-top:10px solid #f1f1f1;overflow:hidden;">  
  <li>   
   <span>提现金额</span>
   <input class="Sizing" style="width:35%" id="inputmoney" onchange="showkoumoney()"><input class="Sizing" value="元" style="width:10%;border:none" readonly>
  </li>
  <li>   
   <span>平台扣费</span>
   <input class="Sizing" style="width:35%" id="koumoney" readonly><input class="Sizing" value="元" style="width:10%;border:none" readonly>
  </li>
  <li>
   <span>银&nbsp;&nbsp;行&nbsp;&nbsp;卡</span>
   <select class="Sizing" id="select_card" onchange="selectcard()"><option>请选择</option></select>
  </li>
  </ul>
  <p class="UpLoadTit">银行卡信息</p>
  <ul class="EnterId" style="width:96%;padding:0 2%;background:#fff;overflow:hidden;margin-top:-5px">
  <li>
   <span>真实姓名</span>
   <input class="Sizing" id="truename">
  </li> 
  <li>
   <span>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户</span>
   <input class="Sizing" id="card">
  </li>
  <li>
   <span>开&nbsp;&nbsp;户&nbsp;&nbsp;行</span>
   <input class="Sizing" id="address">
  </li>
  <li>
   <span>支&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;行</span>
   <input class="Sizing" id="area">
  </li> 
  <li>
   <span>交易密码</span>
   <input class="Sizing" type="password" id="pwd">
  </li>
 </ul>
 <input type="button" class="SubmitBtn" value="保存" onclick="save()">
 <div class="MenuBar"  id="menuDiv">
 </div><!--MenuBar end--> 
</body>
</html>
<script src="Js/common.js" type="text/javascript"></script>
<script src="Js/user.js" type="text/javascript"></script>
<script language="javascript">
    bindcard();
</script>
